const SMSClient = require('@alicloud/sms-sdk')
const account = require('../config/aliyun-account')
const smsClient = new SMSClient(account)

exports.sendCode = function(phone, code) {
  return smsClient.sendSMS({
    PhoneNumbers: phone,
    SignName: 'yourSignName',
    TemplateCode: 'SMS_TemplateID',
    TemplateParam: `{"code": ${code}}`
  })
}
exports.smsClient = smsClient

